package net.sppan.blog.job;

import java.util.Timer;
import java.util.TimerTask;

import net.sppan.blog.store.OfferStore;

import com.jfinal.log.Log;

public class ReloadOfferJob {
	private static final Log log = Log.getLog(ReloadOfferJob.class);

	public static void monitor() {
		Timer timer = new Timer();
		timer.schedule(new ReloadOfferJob().new ReloadTask(), 60000, 60000 * 3);

	}

	class ReloadTask extends TimerTask {

		@Override
		public void run() {
			try {
				log.error("reload start...");
				OfferStore.getInstance().init();
				log.error("reload end");
			} catch (Exception e) {

			}

		}

	}
}
